package com.terrace.web.tagext.easyui;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.terrace.web.tagext.easyui.support.DataGridTagSupport;

/**
 * easyui数据表格标签
 * 
 * @author jiangyg
 *
 */
public class DataGridTag extends DataGridTagSupport {

	private static final long serialVersionUID = -4563357751354918078L;
	
	/**
	 * 日志
	 */
	private static final Logger logger = LoggerFactory.getLogger(DataGridTag.class);

	public int doEndTag() throws JspException {
		try {
			JspWriter out = this.pageContext.getOut();
			out.print(this.bulidGrid());
		} catch (Exception e) {
			logger.error("生成easyui表格失败：", e);
		}
		return EVAL_PAGE;
	}
	
	@Override
	public String assembleExtendDataOptions() {
		return this.transferExtensionForStr();
	}
	
	@Override
	public String gridType() {
		return "datagrid";
	}

}
